import 'package:dio/dio.dart';
import 'package:puppy_store/models/goods_detail_model.dart';
import 'package:puppy_store/service/requests.dart';

class GoodsDetailApi {
  static Future<GoodsDetailModel> getGoodsDetail(String id) async {
    String path = '/goods/app?id=$id';
    Response response = await PuppyRequestManager().handleRequest(path, 'GET');
    Map res = response.data['result'];
    // 转模型
    GoodsDetailModel goodsDetailModel = GoodsDetailModel.fromJson(res);
    return goodsDetailModel;
  }
}
